]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Fix wrong result handling of remote calls
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 26 Jun 2012 15:44:24 +0000 (17:44 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Tue, 26 Jun 2012 16:06:26 +0000 (18:06 +0200)
When using dbus-glib, single return values were special-cased to
be returned verbatim rather than as array with a single element.
This is no longer true since switching to GDBus, so fix the places
where the change was overlooked.

https://bugzilla.gnome.org/show_bug.cgi?id=678852

js/gdm/powerMenu.js
js/ui/userMenu.js

index 3804ec5685b3e1cc3894c48b6eb2389cda7abd01..613a89607cb98673175965e76d35c185998dcd92 100644 (file)
@@ -70,7 +70,7 @@ const PowerMenuButton = new Lang.Class({
             this._systemdLoginManager.CanPowerOffRemote(Lang.bind(this,
                 function(result, error) {
                     if (!error)
-                        this._haveShutdown = result != 'no';
+                        this._haveShutdown = result[0] != 'no';
                     else
                         this._haveShutdown = false;
 
@@ -81,7 +81,7 @@ const PowerMenuButton = new Lang.Class({
             this._consoleKitManager.CanStopRemote(Lang.bind(this,
                 function(result, error) {
                     if (!error)
-                        this._haveShutdown = result;
+                        this._haveShutdown = result[0];
                     else
                         this._haveShutdown = false;
 
@@ -97,7 +97,7 @@ const PowerMenuButton = new Lang.Class({
             this._systemdLoginManager.CanRebootRemote(Lang.bind(this,
                 function(result, error) {
                     if (!error)
-                        this._haveRestart = result != 'no';
+                        this._haveRestart = result[0] != 'no';
                     else
                         this._haveRestart = false;
 
@@ -108,7 +108,7 @@ const PowerMenuButton = new Lang.Class({
             this._consoleKitManager.CanRestartRemote(Lang.bind(this,
                 function(result, error) {
                     if (!error)
-                        this._haveRestart = result;
+                        this._haveRestart = result[0];
                     else
                         this._haveRestart = false;
 
index 8e9c3e703c66c0c1a78c248b9b0db2eac23e228c..41bf9988966f94e3339dd6d711c5dd6e47530d1e 100644 (file)
@@ -584,7 +584,7 @@ const UserMenuButton = new Lang.Class({
         this._session.CanShutdownRemote(Lang.bind(this,
             function(result, error) {
                 if (!error) {
-                    this._haveShutdown = result;
+                    this._haveShutdown = result[0];
                     this._updateSuspendOrPowerOff();
                 }
             }));